Skip to content

Skip type-only peers in example imports - #1186

Open
jong-kyung wants to merge 10 commits into
TanStack:mainfrom
jong-kyung:fix/ignore-types-runtime-peers
Open

jong-kyung wants to merge 10 commits into
TanStack:mainfrom
jong-kyung:fix/ignore-types-runtime-peers

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Aug 28, 2026 •

Copy link
Copy Markdown

Summary

While opening the Basic Use Table example, the preview failed with the following error:

Error: esm.sh returned invalid metadata for https://esm.sh/@types/react-dom@%5E19.2.4?meta
스크린샷 2026-08-28 오전 11 33 15

The import resolver treated @types/* peer dependencies as runtime packages and requested metadata from esm.sh. This PR excludes type-only peers from runtime peer resolution and adds regression coverage.

After the change, I confirmed that the example renders correctly.

스크린샷 2026-08-28 오전 11 42 22

Summary by CodeRabbit

  • Bug Fixes

    • TypeScript type-definition packages are no longer automatically included when resolving example workspace dependencies.
    • Runtime peer dependencies continue to resolve as expected.
  • Tests

    • Added coverage confirming type-only dependencies are excluded from package resolution.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 660751bd-f709-4cdb-ada6-7042f17f1b5f

📥 Commits

Reviewing files that changed from the base of the PR and between 8d2ecf2 and 158e322.

📒 Files selected for processing (1)
  • tests/example-imports.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The example workspace import resolver now skips peer packages whose names start with @types/. The test fixture includes @types/react as a peer and verifies that it does not trigger a metadata request.

Changes

Example Import Resolution

Layer / File(s) Summary
Filter type-only peers during resolution
src/utils/example-imports.ts, tests/example-imports.test.ts
The resolver excludes @types/* peer packages. The test confirms that runtime peers are resolved and type-only peers do not trigger metadata requests.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: kevinvandy

Merge Risk: ⚪ Minimal · up to 158e3

Runtime peers remain resolvable, and type-definition peers are already excluded by existing filters. No material merge-blocking risk is established.

Architecture Summary

Architecture risk: 🔵 Low · up to 158e3

The change affects 2 systems.

Changed systems: src, tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.
  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/utils/example-imports.ts: Added a !peerPackage.startsWith('@types/') guard to the peer-package collection condition, so @types/* peer packages are excluded from declaredPeerPackages and are no longer resolved and added to resolvedGroups.
  • observed — Modified behavior in tests/example-imports.test.ts: The test title now specifies that it resolves declared runtime peers and ignores type-only peers.
  • observed — Modified behavior in tests/example-imports.test.ts: The fixture adds @types/react as a dev dependency and includes it in @example/ui peer metadata alongside react; the metadata fetch now records requests for this test.
  • observed — Modified behavior in tests/example-imports.test.ts: Adds an assertion that no recorded metadata request URL includes @types/react.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: excluding type-only peers from example import resolution.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants